package com.example.tijian_doctor_backend.controller;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.example.tijian_doctor_backend.mapper.CidetailedreportMapper;
import com.example.tijian_doctor_backend.pojo.Cidetailedreport;
import com.example.tijian_doctor_backend.result.Result;
import com.example.tijian_doctor_backend.service.CiDetailedReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/6/24 10:54
 * @version: 1.0
 */
@RestController
@Slf4j
@RequestMapping("/ciDetailedReport")
@Api(tags ="检查项接口")
@CrossOrigin("*")
public class CiDetailedReportController {

    @Autowired
    private CiDetailedReportService ciDetailedReportService;

    @ApiOperation("保存检查项")
    @PostMapping("/updateCiDetailedReport")
    public Result  updateCiDetailedReport(@RequestBody List<Cidetailedreport> arr){

        UpdateWrapper<Cidetailedreport> updateWrapper=new UpdateWrapper<Cidetailedreport>();

        for(Cidetailedreport cur:arr){
            System.out.println(cur.toString());
        }
        ciDetailedReportService.saveOrUpdateBatch(arr);

        return Result.success("ss");

    }
}
